package Transformation;

import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.Transformer;

public class SOAPTransform {

	public static boolean SOAPTransformation(String inXML, String inXSL, String outXML) {
		boolean error = false;
		TransformerFactory factory = TransformerFactory.newInstance();
		StreamSource xslStream = new StreamSource(inXSL);
		try {
			Transformer transformer = factory.newTransformer(xslStream);
			StreamSource in = new StreamSource(inXML);
			StreamResult out = new StreamResult(outXML);
			transformer.transform(in, out);
		} catch (Exception ex) {
			ex.printStackTrace();
			error = true;
		}
		return error;
	}
}
